class Game {
    setup () { }
    start () {
        this.setup()
        this.play()
        this.finish()
    }
    play () { }
    finish () { }
}
class Chess extends Game {
    setup () {
        console.log('配置象棋游戏')
    }
    play () {
        console.log('开始象棋游戏')
    }
    finish () {
        console.log('象棋游戏结束')
    }
}
class TicTacToe extends Game {
    setup () {
        console.log('配置五子棋')
    }
    play () {
        console.log('开始五子棋')
    }
    finish () {
        console.log('五子棋结束')
    }
}

let game = new Chess()
game.start()

game = new TicTacToe()
game.start()